package com.dianping.cat.configuration.server.entity;

import com.dianping.cat.configuration.server.BaseEntity;
import com.dianping.cat.configuration.server.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;

public class StorageConfig
  extends BaseEntity<StorageConfig> {
/*  10 */   private String m_localBaseDir = "target/bucket";

/*  12 */   private int m_maxHdfsStorageTime = 15;

/*  14 */   private int m_localReportStorageTime = 3;

/*  16 */   private int m_localLogivewStorageTime = 7;

  private boolean m_harMode = true;

  private Map<String, HdfsConfig> m_hdfses = new LinkedHashMap();

/*  22 */   private Map<String, HarfsConfig> m_harfses = new LinkedHashMap();

  private Map<String, Property> m_properties = new LinkedHashMap();

/*  26 */   private int m_uploadThread = 5;






/*  33 */   public void accept(IVisitor visitor) { visitor.visitStorage(this); }


  public StorageConfig addHarfs(HarfsConfig harfs) {
/*  37 */     this.m_harfses.put(harfs.getId(), harfs);
/*  38 */     return this;
  }

  public StorageConfig addHdfs(HdfsConfig hdfs) {
/*  42 */     this.m_hdfses.put(hdfs.getId(), hdfs);
/*  43 */     return this;
  }

  public StorageConfig addProperty(Property property) {
/*  47 */     this.m_properties.put(property.getName(), property);
/*  48 */     return this;
  }


  public boolean equals(Object obj) {
/*  53 */     if (obj instanceof StorageConfig) {
/*  54 */       StorageConfig _o = (StorageConfig)obj;

/*  56 */       if (!equals(getLocalBaseDir(), _o.getLocalBaseDir())) {
/*  57 */         return false;
      }

/*  60 */       if (getMaxHdfsStorageTime() != _o.getMaxHdfsStorageTime()) {
/*  61 */         return false;
      }

/*  64 */       if (getLocalReportStorageTime() != _o.getLocalReportStorageTime()) {
/*  65 */         return false;
      }

/*  68 */       if (getLocalLogivewStorageTime() != _o.getLocalLogivewStorageTime()) {
/*  69 */         return false;
      }

/*  72 */       if (getHarMode() != _o.getHarMode()) {
/*  73 */         return false;
      }

/*  76 */       if (!equals(getHdfses(), _o.getHdfses())) {
/*  77 */         return false;
      }

/*  80 */       if (!equals(getHarfses(), _o.getHarfses())) {
/*  81 */         return false;
      }

/*  84 */       if (!equals(getProperties(), _o.getProperties())) {
/*  85 */         return false;
      }

/*  88 */       if (getUploadThread() != _o.getUploadThread()) {
/*  89 */         return false;
      }


/*  93 */       return true;
    }

/*  96 */     return false;
  }


/* 100 */   public HarfsConfig findHarfs(String id) { return (HarfsConfig)this.m_harfses.get(id); }



/* 104 */   public HdfsConfig findHdfs(String id) { return (HdfsConfig)this.m_hdfses.get(id); }



/* 108 */   public Property findProperty(String name) { return (Property)this.m_properties.get(name); }



/* 112 */   public Map<String, HarfsConfig> getHarfses() { return this.m_harfses; }



/* 116 */   public boolean getHarMode() { return this.m_harMode; }



/* 120 */   public Map<String, HdfsConfig> getHdfses() { return this.m_hdfses; }



/* 124 */   public String getLocalBaseDir() { return this.m_localBaseDir; }



/* 128 */   public int getLocalLogivewStorageTime() { return this.m_localLogivewStorageTime; }



/* 132 */   public int getLocalReportStorageTime() { return this.m_localReportStorageTime; }



/* 136 */   public int getMaxHdfsStorageTime() { return this.m_maxHdfsStorageTime; }



/* 140 */   public Map<String, Property> getProperties() { return this.m_properties; }



/* 144 */   public int getUploadThread() { return this.m_uploadThread; }
/*     */



/* 165 */   public boolean isHarMode() { return this.m_harMode; }



  public void mergeAttributes(StorageConfig other) {
/* 170 */     if (other.getLocalBaseDir() != null) {
/* 171 */       this.m_localBaseDir = other.getLocalBaseDir();
    }

/* 174 */     this.m_maxHdfsStorageTime = other.getMaxHdfsStorageTime();

/* 176 */     this.m_localReportStorageTime = other.getLocalReportStorageTime();

/* 178 */     this.m_localLogivewStorageTime = other.getLocalLogivewStorageTime();

/* 180 */     this.m_harMode = other.getHarMode();

/* 182 */     this.m_uploadThread = other.getUploadThread();
  }


/* 186 */   public HarfsConfig removeHarfs(String id) { return (HarfsConfig)this.m_harfses.remove(id); }



/* 190 */   public HdfsConfig removeHdfs(String id) { return (HdfsConfig)this.m_hdfses.remove(id); }



/* 194 */   public Property removeProperty(String name) { return (Property)this.m_properties.remove(name); }


  public StorageConfig setHarMode(boolean harMode) {
/* 198 */     this.m_harMode = harMode;
/* 199 */     return this;
  }

  public StorageConfig setLocalBaseDir(String localBaseDir) {
/* 203 */     this.m_localBaseDir = localBaseDir;
/* 204 */     return this;
  }

  public StorageConfig setLocalLogivewStorageTime(int localLogivewStorageTime) {
/* 208 */     this.m_localLogivewStorageTime = localLogivewStorageTime;
/* 209 */     return this;
  }

  public StorageConfig setLocalReportStorageTime(int localReportStorageTime) {
/* 213 */     this.m_localReportStorageTime = localReportStorageTime;
/* 214 */     return this;
  }

  public StorageConfig setMaxHdfsStorageTime(int maxHdfsStorageTime) {
/* 218 */     this.m_maxHdfsStorageTime = maxHdfsStorageTime;
/* 219 */     return this;
  }

  public StorageConfig setUploadThread(int uploadThread) {
/* 223 */     this.m_uploadThread = uploadThread;
/* 224 */     return this;
  }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-core-3.0.0.jar!/com/dianping/cat/configuration/server/entity/StorageConfig.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */